package com.ankicoo.practice.caculate;

import org.apache.commons.math3.linear.Array2DRowFieldMatrix;
import org.apache.commons.math3.linear.FieldDecompositionSolver;
import org.apache.commons.math3.linear.FieldLUDecomposition;

import java.math.BigDecimal;
import java.util.List;

/**
 * Description:
 *
 * @author : QCYANG
 * @date : 2022/2/28 17:13
 */
public class Demo1 {
    private BigDecimal total;
    private List<BigDecimal> p;
    private BigDecimal principal;
    private BigDecimal rent;

    /**
     * 等额租金 求本金和租金
     * @return
     */
    private BigDecimal[][] sameRent4PrincipalAndRent(){
        BigDecimal[][] a = new BigDecimal[3][3];
        for (int i = 0 ;i<3;i++){
            for (int j = 0 ;j<3;j++){
                if (a[i][j].compareTo(BigDecimal.ZERO)==0){
                    continue;
                }else {

                }
            }
        }
        return a;
    }

    /**
     *
     * @param row 当前行
     * @param col 当前列
     * @param a 二元数组
     */
    private void caculate(int row,int col,BigDecimal[][] a){
        for (int i = 0 ;i<row;i++){
            for (int j = 0 ; j <col;j++){
//                a[i][j]

            }
        }
//        FieldDecompositionSolver<BigDecimal> solver = new FieldLUDecomposition<>();
//        Array2DRowFieldMatrix


    }

}
